package com.znow.admin.system.security.service;

import com.znow.admin.system.security.model.dto.PermissionsTreeDTO;
import com.znow.admin.system.security.model.res.PermissionPageRequest;
import com.znow.admin.system.security.model.res.PermissionRequest;
import com.znow.admin.system.security.model.vo.component.ComponentVO;
import com.znow.common.model.PageResult;

import java.util.List;

/**
 * 系统权限服务
 *
 * @author Nemo
 * @date 2022/11/01
 */
public interface SysPermissionsService {

    /**
     * 根据用户查询用户的所有的权限
     *
     * @param userId 用户id
     * @return {@link List}<{@link PermissionsTreeDTO}>
     */
    List<PermissionsTreeDTO> getPermissionsByUserId(Long userId);

    /**
     * 根据父类ID查询权限数据
     *
     * @param parentId 父id
     * @return {@link List}<{@link PermissionsTreeDTO}>
     */
    List<PermissionsTreeDTO> getPermissionsByParentId(Long parentId);

    /**
     * 得到树权限列表
     *
     * @param userId 请求
     * @return {@link List}<{@link PermissionsTreeDTO}>
     */
    List<PermissionsTreeDTO> getAllTreePermissionsList(Long userId);

    /**
     * 获得权限列表
     *
     * @param request 请求
     * @return {@link List}<{@link PermissionsTreeDTO}>
     */
    PageResult<PermissionsTreeDTO> getPagePermissionsList(PermissionPageRequest request);

    /**
     * 获取菜单
     *
     * @param userId 用户id
     * @return {@link List}<{@link ComponentVO}>
     */
    List<ComponentVO> getMenu(Long userId);

    Boolean addPermissions(PermissionRequest permissionRequest);

    Boolean deletePermissions();
}
